<?php

namespace App\Http\Controllers;

use App\Http\Requests\QiumaiRequest;
use App\Http\Requests\QiuzuRequest;
use App\Models\Qiumai;
use App\Models\Qiuzu;
use Illuminate\Http\Request;

class BiaodanController extends Controller
{
    public function  qiuzu(QiuzuRequest  $qiuzuRequest){

         $qiuzu=   new Qiuzu();
         $qiuzu->quyu=$qiuzuRequest->input('quyu');
         $qiuzu->mianji=$qiuzuRequest->input('mianji');
         $qiuzu->hangye=$qiuzuRequest->input('hangye');
         $qiuzu->zujin=$qiuzuRequest->input('zujin');
         $qiuzu->xingming=$qiuzuRequest->input('xingming');
         $qiuzu->dianhua=$qiuzuRequest->input('dianhua');
         $qiuzu->save();
         return response()->json([
             'code'=>200,
             'message'=>'求租成功',
         ]);
    }
    public function qiumai(QiumaiRequest  $qiumaiRequest){
        $qiuzu=   new Qiumai();
        $qiuzu->quyu=$qiumaiRequest->input('quyu');
        $qiuzu->zongjia=$qiumaiRequest->input('zongjia');
        $qiuzu->mianji=$qiumaiRequest->input('mianji');
        $qiuzu->dianhua=$qiumaiRequest->input('dianhua');
        $qiuzu->xingming=$qiumaiRequest->input('xingming');
        $qiuzu->dianhua=$qiumaiRequest->input('dianhua');
        $qiuzu->save();
        return response()->json([
            'code'=>200,
            'message'=>'求买成功',
        ]);
    }
}
